package com.example.demo.service;

import com.example.demo.entity.commodity;
import com.example.demo.mapper.commoditymapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class commodityservice implements commodityserviceInterface{
    @Autowired
    commoditymapper commoditydao;

    public PageInfo<commodity> display(Integer pagenum, Integer pagesize) {
        PageHelper.startPage(pagenum, pagesize);
        List<commodity> como = commoditydao.display();
        PageInfo<commodity> pageinfo = new PageInfo<>(como);

        return pageinfo;
    }
    public int insert(commodity c) { return commoditydao.insert(c);}
    public int update(commodity c) { return commoditydao.update(c);}
    public int delete(commodity c) { return commoditydao.delete(c);}
    public  List<commodity> search(commodity c) { return commoditydao.search(c);}
    public int verify(commodity c) { return commoditydao.verify(c);}
}
